package com.mirai.mirai_boot.utils;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author : CP
 * @version: 1.0
 * @program : mirai_boot
 * @description : 截取字符串
 * @date : 2021-07-02 17:18
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CutStringUtils {

    /**
     * 执行类型
     */
    private String type;

    /**
     * 执行参数
     */
    private String para;


    public CutStringUtils(String text){
        if (text.indexOf(" ")!=-1 && text.indexOf(" ")+1< text.length()){
            // 获取执行类型
            this.type = text.substring(0, text.indexOf(" "));
            // 执行参数
            this.para = text.substring(text.indexOf(" ") + 1, text.length());
        }else {
            this.type = text;
        }
    }
}
